package com.scy.java.object.inter;

public class VehicleTest {
    public static void main(String[] args) {
        Developer d = new Developer();
        //创建三个交通工具，保存在数组中
        Vehicle[] v = new Vehicle[3];
        v[0] = new Bicycle("捷安特","品红色");
        v[1] = new ElectricVehicle("雅迪","天蓝色");
        v[2] = new Car("比亚迪","黑色","陕Au6688");
        for (int i = 0; i < v.length; i++) {
            d.takingVehicle(v[i]);
            if (v[i] instanceof IPower){
                ((IPower) v[i]).power();
            }
        }
    }
}
